package cn.edu.scau.cmi.front.domain;

import java.io.Serializable;
import java.util.Comparator;

import cn.edu.scau.cmi.ema.domain.Brand;

public class Option implements Serializable , Comparable<Option> , Comparator<Option>{

	private static final long serialVersionUID = 1L;
	private String entityName;
	private String name;
	private String imagePath;
	private Integer level;

	public Option() {
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public String getEntityName() {
		return entityName;
	}

	public void setEntityName(String entityName) {
		this.entityName = entityName;
	}

	public String getImagePath() {
		return imagePath;
	}

	public void setImagePath(String imagePath) {
		this.imagePath = imagePath;
	}

	@Override
	public int compareTo(Option o) {
		if (this.getEntityName().compareTo(o.getEntityName())> 0) {
			return 1;
		} else if (this.getEntityName().compareTo(o.getEntityName())== 0) {
			return 0;
		} else {
			return -1;
		}

	}

	@Override
	public int compare(Option o1, Option o2) {
		// TODO Auto-generated method stub
		return o1.getEntityName().compareTo(o2.getEntityName());
	}

}
